package com.lin.controller;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.lin.pojo.DFile;
import com.lin.pojo.MDesignProcedureDetails;
import com.lin.pojo.PageVo;
import com.lin.service.MDesignProcedureDetailsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
public class MDesignProcedureDetailsController {
    @Autowired
    MDesignProcedureDetailsService mDesignProcedureDetailsService;

   @GetMapping("/querydesignDetails.action")
    public PageVo<MDesignProcedureDetails> queryAlldetails(MDesignProcedureDetails mDesignProcedureDetails,
                                                           @RequestParam(value = "pagenum",defaultValue = "1") Integer pageno,
                                                           @RequestParam(value = "pagesize",defaultValue = "5") Integer pagesize){
        return mDesignProcedureDetailsService.queryallDetails(mDesignProcedureDetails,pageno,pagesize);

    }

    @RequestMapping("/querydesignDetailsbydid.action")
    public List<MDesignProcedureDetails> querydesignDetailsbydid(String id){
        QueryWrapper<MDesignProcedureDetails> queryWrapper =new QueryWrapper<MDesignProcedureDetails>();
        queryWrapper.eq("parent_id",id);

        return mDesignProcedureDetailsService.list(queryWrapper);
    }
}
